<%@ include file="/Pages/Jsp/Common/header.jsp"%>
<script language="javascript" type="text/javascript"
	src="<%=request.getContextPath()%>/Pages/Js/userJS.js"></script>
<html:html>
<script type="text/javascript">
    $(document).ready(function() {
           
        if($(".requiredNotice").html()== ""){
           $(".requiredNotice").hide(); 
        }
    });
</script>

<div style="width:960px; margin-left:auto;margin-right:auto">
<form name="frmCreate"
	action="<%=request.getContextPath()%>/user/createUser/createUser.do"
	method="post">

	<div>

		<h3>
			Create a User
		</h3>
		<hr />
	</div>
	<div>
		<logic:present name="Success">
			<div class="notice span-8 ">
				<b>${Success}</b>
			</div>
		</logic:present>
	</div>
	<div class="requiredNotice span-8 error ">
		<logic:present name="Failed">
				${Failed}
		</logic:present>
	</div>
	<hr class="space prepend">
	<p>
		<label class="span-4  align-left ">
			<span class="errtxt">*</span> Username:
		</label>
		<input id="User" name="username" onkeyup="checkInput(this)"
			class="span-4 " type="text"
			<logic:present name="createUserName">value="<%=request.getAttribute("createUserName")%>"</logic:present>>
		<SPAN class="errorText"><html:errors property="username" /> </SPAN>
	</p>
	<p>
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> Password:
		</label>
		<input id="password" name="password" class="span-4" type="password">
		<SPAN class="errorText"><html:errors property="password" /> </SPAN>

	</p>
	<p>
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> Confirm Password:
		</label>
		<input id="confirmpwd" name="confirmpwd" class="span-4"
			type="password">
		<SPAN class="errorText"><html:errors property="confirmpwd" />
		</SPAN>
	</p>
	<p>
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> First Name:
		</label>
		<input id="firstname" name="firstname" onkeyup="checkInput(this)"
			class="span-4" type="text"
			<logic:present name="createFirstName">value="<%=request.getAttribute("createFirstName") %>"</logic:present>>
		<SPAN class="errorText"><html:errors property="firstname" /> </SPAN>
	</p>
	<p>
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> Last Name:
		</label>
		<input id="lastname" name="lastname" onkeyup="checkInput(this)"
			class="span-4" type="text"
			<logic:present name="createLastName">value="<%=request.getAttribute("createLastName") %>"</logic:present>>
		<SPAN class="errorText"><html:errors property="lastname" /> </SPAN>
	</p>
	<p>



		<label class="span-4 align-left ">
			<span class="errtxt">*</span> User Category:
		</label>
		<input id="category" name="category" value="trainee" type="radio"
			checked="checked" onclick="roleChange(), bindRole();">
		Trainee
		<input id="category" name="category" value="employee" type="radio"
			onclick="roleChange();">
		Employee
		<SPAN class="errorText"><html:errors property="" /> </SPAN>
	</p>

	<p id="employeeRoles" class="noDisplay">
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> Role:
		</label>
		<logic:iterate id="roleList" name="roleList"
			type="com.capgemini.fs.app.ekms.model.Role">
			<input id="role1" name="role" value="<%=roleList.getName()%>"
				type="checkbox"><%=roleList.getName()%>
		</logic:iterate>
		<SPAN class="errorText"><html:errors property="role" /> </SPAN>
	</p>
	<p id="traineeRole">
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> Role:
		</label>
		<input type="checkbox" name="role" id="trainee" value="Visitor"
			checked="checked" />
		Visitor
		<SPAN class="errorText"><html:errors property="role" /> </SPAN>
	</p>




	<p>
		<label class="span-4 align-left ">
			<span class="errtxt">*</span> Email:
		</label>
		<input id="email" name="email" class="span-4" type="text"
			<logic:present name="createEmail">value="<%=request.getAttribute("createEmail") %>"</logic:present>>
		<SPAN class="errorText"><html:errors property="email" /> </SPAN>
	</p>



	<p>
		<label class="span-4 align-left ">
			<span class="errtxt"></span> Active:
		</label>
		<select id="Active" name="active" class="span-4" name="selactive">
			<option value="0" id="isactive" selected="selected">
				Yes
			</option>
			<option value="1" id="noactive">
				No
			</option>
		</select>
	</p>
	<p>
		<label class="span-4 align-left ">
			<span class="errtxt"></span> Group:
		</label>
		<div class="mutifields">
			<logic:iterate id="groupList" name="groupList"
				type="com.capgemini.fs.app.ekms.model.Group">
				<input id="ckbgroup" name="group"
					value="<%=groupList.getGroupName()%>" type="checkbox"><%=groupList.getGroupName()%>
			</logic:iterate>
		</div>
		<SPAN class="errorText"><html:errors property="group" /> </SPAN>


	</p>
	<p>
		<label class="span-4 align-left ">
			<span class="errtxt"></span> Phone No.:
		</label>
		<input id="phoneno" name="phoneno" class="span-4" type="text"
			<logic:present name="createPhoneNo">value="<%=request.getAttribute("createPhoneNo") %>"</logic:present>>
		<SPAN class="errorText"><html:errors property="phoneno" /> </SPAN>
	</p>

	<hr class="space">
	<p>
	</p>
	<div class=" align-left">
		<input value="Create" type="button" onclick=
	createValidation();
>
		&nbsp;
		<input value="Reset" type="reset" onclick=
	createReset();
>
		&nbsp;
		<input value=" Back" type="button" onclick=
	history.back();
>
		<hr class="space" />
	</div>

</form>
</div>
</html:html>

